import { get, post } from './index'

// 获取套餐详情
export function getCardClass(params) {
  return get('/v1/ft/market/partnergoods/get', params)
}

// 发送验证码
export function sendMsg(data) {
  return post('/v1/ft/market/sms/send', data)
}

// 校验验证码
export function checkVerifyCode(data) {
  return post('/v1/ft/market/sms/verify', data)
}

export function getNumberAddress() {
  return post('/v1/ft/market/ydhk/addr-gets')
}

export function getPoolNumber(data) {
  return post('/v1/ft/market/ydhk/numberpool-list', data)
}

export function getToken(code) {
  return post(`/v1/ft/market/ydhk/token-get?code=${code}`)
}

export function lockNumber(data) {
  return post('/v1/ft/market/ydhk/number-lock', data)
}

export function apply(data, urlParam = '') {
  return Promise.resolve(post(`/v1/ft/market/ydhk/apply?${urlParam}`, data))
}

// export function apply(data, urlParam = '') {
//   return new Promise(resolve => {
//     setTimeout(() => {
//       // post(`/v1/ft/market/ydhk/apply?${urlParam}`, data).then(res => {
//       resolve({ code: 1002112, data: { order_no: '12345' } })
//       // })
//     }, 2000)
//   })
// }

export function getCardNaprotocol(params) {
  return get('/v1/ft/market/ydhk/protocal-get', params)
}

export function getIdCardUploadUrl(data, urlParam = '') {
  return post(`/v1/ft/market/ydhk/idcheckurl-get?${urlParam}`, data)
}

export function helpApply(data) {
  return post('/v1/ft/market/ydhk/helpuser-apply', data)
}

export function chinaNetFastApply(data) {
  return post('/v1/ft/market/dxnbhk/fast-apply', data)
}
